<?php
class KomunikatyController{
	private $msg = false;
	private $tresc = array();
	private $i = 0;
	
	function __construct(){
		$this->tresc["msg"] = array();
		$this->tresc["err"] = array();
	}
	
	public function __set($typ='msg',$value){
		$this->msg = true;		
		$this->tresc[$typ][$this->i] = $value;
		$this->i++;
	}
	
	public function indexAction(){
		if($this->msg){
			if (count($this->tresc["msg"]) != 0){
				tools::_assign("komunikaty",$this->tresc["msg"]);
				tools::_display("section/const_komunikaty.tpl");
			}			
			if (count($this->tresc["err"]) != 0){
				tools::_assign("komunikaty",$this->tresc["err"]);
				tools::_display("section/const_komunikaty.tpl");
			}
		}
	}
}